package com.ali.ttt.webSocket.controller;

import com.ali.ttt.webSocket.utils.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author : yuxl
 * @create 2024/7/15 11:50 AM
 */
@Slf4j
@RestController
@RequestMapping("/websocket/message")
@Api(tags = "websocket 服务端:消息")
public class WebSocketMessageController {

    @Resource
    private MessageUtil messageUtil;

    @PostMapping("/sendAll")
    @ApiOperation(value = "发送消息给客户端")
    public void sendAll(@RequestParam String msg) {
        messageUtil.sendAll(msg);
    }
}
